{extend name="public:base" /}
{block name="header"}
<style>
    .form input{
        width:300px;
        padding:5px;
    }
    .form input:focus{
        border:1px solid #ff0000;
    }
</style>
{/block}
{block name="main"}
    <div class="ShareAnyContainer" style="font-size: 14px;">
        当前位置：<a href="" title="首页">首页</a>&nbsp;&nbsp;/&nbsp;&nbsp;<a
            href="{:url('shop/login/index')}" title="登录">登录</a>
    </div>
    <div class="ShareAnySeparate"></div>
    <div class="ShareAnyContainer">
        <div class="line"></div>
    </div>
    <div class="ShareAnySeparate"></div>
    <div class="ShareAnyContainer form" style="line-height: 50px; text-align: center;">
        <table align="center" border='0'>
        <tr>
            <td style="text-align:left">账号：</td>
            <td><input type="text" id="account"></td>
        </tr>
        <tr>
            <td style="text-align:left">密码：</td>
            <td><input type="password" id="password"></td>
        </tr>
       <!--  <tr >
            <td style="text-align:left">验证码：</td>
            <td style="vertical-align: top;">
            <input type="text" id="code" width="200px" style="width: 142px; ">
            <img width="100px" height="40px" id="imgcode" alt="验证码"  src="{:captcha_src()}"  title="点击刷新" style="vertical-align: bottom;"  class="verify" onclick="javascript:this.src='{:captcha_src()}?rand='+Math.random()">
            </td>
        </tr> -->
        </table>
        <div  style="vertical-align: top; height:50px;">
        
        </div>
        <p>
            <button id="submit" style="padding:10px 25px;">登录</button>
        </p>
         <p>
             <a href="{:url('shop/login/find')}" title="找回密码">找回密码</a></p>
    </div>
    <input type="hidden" id="redirect" value="']}">
{/block}
{block name="footer"}
    <script>
        $(function () {
            $("#submit").on("click", function () {
                var mobile = $('#account').val();
                var password = $('#password').val();
                var code = $("#code").val();
                if(mobile == '' || password == ''){
                    alert('内容有误');return false;
                }
                $.get("{:url('shop/login/index')}", {mobile:mobile, password:password, code:code}, function(e){
                    if(e.code === 1001){
                        alert(e.msg);return false;
                    }else{
                        window.location.href = '{$url}';
                    }
                });
            });
        });    
    
    </script>
{/block}